package pl.zmudzinski.aop;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.annotation.Before;

@Aspect
public class BeanAdvisor {
    public Integer counter = 0;

    @Pointcut("execution(public * pl.zmudzinski.beans..*(..))")
    public void publicMethod() {
    }
    @Before("publicMethod()")
    public void increaseCounter() {
        counter++;
    }

    public Integer getCounter() {
        return counter;
    }
}
